home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / timepilot.swf / scripts / frame_31 / PlaceObject2_227_11 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-13  |  1.7 KB  |  82 lines

  1. onClipEvent(enterFrame){
  2.    if(Start == true && Dead == false)
  3.    {
  4.       if(hits == 0)
  5.       {
  6.          if(dir == 1)
  7.          {
  8.             this.Boss.gotoAndStop(2);
  9.          }
  10.          else if(dir == 2)
  11.          {
  12.             this.Boss.gotoAndStop(3);
  13.          }
  14.       }
  15.       else if(hits >= 1 && hits < 10)
  16.       {
  17.          if(dir == 1)
  18.          {
  19.             this.Boss.gotoAndStop(4);
  20.          }
  21.          else if(dir == 2)
  22.          {
  23.             this.Boss.gotoAndStop(5);
  24.          }
  25.       }
  26.       else if(hits >= 10 && hits < 20)
  27.       {
  28.          if(dir == 1)
  29.          {
  30.             this.Boss.gotoAndStop(6);
  31.          }
  32.          else if(dir == 2)
  33.          {
  34.             this.Boss.gotoAndStop(7);
  35.          }
  36.       }
  37.       else if(hits >= 20)
  38.       {
  39.          this.Boss.gotoAndStop(8);
  40.          Dead = true;
  41.       }
  42.       a = 1;
  43.       while(a <= _root.Ship.i)
  44.       {
  45.          if(this.hitTest(_root["Bullet" + a]))
  46.          {
  47.             hits += 1;
  48.             removeMovieClip(_root["Bullet" + a]);
  49.          }
  50.          a++;
  51.       }
  52.       _X = _X + (xspeed - Math.sin(_root.Ship.angle * 0.017453292519943295) * 3);
  53.       _Y = _Y + (yspeed + Math.cos(_root.Ship.angle * 0.017453292519943295) * 3);
  54.       if(_root.Ship.hitTest(_X,_Y,true) && _root.Ship.Dead == false)
  55.       {
  56.          _root.Ship.gotoAndStop("Death");
  57.          _root.Start = false;
  58.          _root.Ship.Dead = true;
  59.       }
  60.       if(_X < -60)
  61.       {
  62.          xspeed = -1;
  63.          dir = 1;
  64.          _X = 510;
  65.       }
  66.       if(_X > 510)
  67.       {
  68.          xspeed = 1;
  69.          dir = 2;
  70.          _X = -60;
  71.       }
  72.       if(_Y < 20)
  73.       {
  74.          _Y = 530;
  75.       }
  76.       if(_Y > 530)
  77.       {
  78.          _Y = 20;
  79.       }
  80.    }
  81. }
  82.